import numpy as np # 处理数组、矩阵
import matplotlib.pyplot as plt  # pip install matplotlib

n1 = plt.imread('google.jpg')
print(n1, type(n1))

plt.imshow(n1)

n2 = np.array([0.299, 0.587, 0.114])

x = np.dot(n1, n2)

plt.imshow(x, cmap='gray')

plt.show()
